<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Define a terminal color</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.ncurses-init-color" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ncurses_init_color</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5 &lt; 5.3.0, PECL ncurses &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">ncurses_init_color</span> &mdash; <span class="dc-title">Define a terminal color</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.ncurses-init-color-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ncurses_init_color</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$color</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$r</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$g</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$b</code></span>
   ) : <span class="type">int</span></div>

  <p class="para rdfs-comment">
   Defines or redefines the given color. When this function is called, all
   occurrences of the given color on the screen, if any, immediately change
   to the new definition.
  </p>
  <p class="para">
   Color capabilities must be supported by the terminal and initialized using
   <span class="function"><a href="ncurses_start_color.html" class="function">ncurses_start_color()</a></span> prior to calling this function.
   In addition, the terminal must have color changing capabilities; use
   <span class="function"><a href="ncurses_can_change_color.html" class="function">ncurses_can_change_color()</a></span> to check for this.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.ncurses-init-color-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">color</code></dt>

     <dd>

      <p class="para">
       The identification number of the color to redefine. It may be one of
       the default color constants.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">r</code></dt>

     <dd>

      <p class="para">
       A color value, between 0 and 1000, for the red component.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">g</code></dt>

     <dd>

      <p class="para">
       A color value, between 0 and 1000, for the green component.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">b</code></dt>

     <dd>

      <p class="para">
       A color value, between 0 and 1000, for the blue component.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.ncurses-init-color-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <em>-1</em> if the function was successful,
   and <em>0</em> if ncurses or terminal
   color capabilities have not been initialized or the terminal does not
   have color changing capabilities.
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.ncurses-init-color-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="ncurses_color_content.html" class="function" rel="rdfs-seeAlso">ncurses_color_content()</a> - Retrieves RGB components of a color</span></li>
    <li class="member"><span class="function"><a href="ncurses_start_color.html" class="function" rel="rdfs-seeAlso">ncurses_start_color()</a> - Initializes color functionality</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>